package com.mac.Messages;

import com.mac.pojo.Messages;
import com.mac.service.MessagesService;
import org.junit.Test;

/**
 * @author 张舜 独家创作
 * version 1.0
 */
public class test {
    MessagesService ms=new MessagesService();
    Messages m=new Messages();
    @Test
    public void insertMessage(){
        m.setMessageId(1);
        m.setContent("lallalalalalala");
        m.setUserId(1);
        m.setCreatedAt(java.sql.Date.valueOf("2024-11-26"));
       boolean flag= ms.insertMessage(m);
        System.out.println(flag);
    }
    @Test
    public void  selectMessageById(){
         System.out.println(ms.selectMessageById(2));
    }
    @Test
    public void selectMessageByUserId(){
        System.out.println(ms.selectMessageByUserId(2));
    }
    @Test
    public void selectAllMessages(){
        System.out.println(ms.selectAllMessages());
    }
    @Test
    public void  updateMessage(){
        m.setMessageId(2);
        m.setContent("lallalalalalala");
        m.setCreatedAt(java.sql.Date.valueOf("2024-11-26"));
        boolean flag= ms.updateMessage(m);
        System.out.println(flag);
    }
    @Test
    public void  deleteMessage(){
        boolean flag=ms.deleteMessage(2);
        System.out.println(flag);

    }
}
